package com.huoyun.company.service;

import com.huoyun.company.dao.CompanyInfoDao;
import com.huoyun.company.dao.CompanyPersonDao;
import com.huoyun.company.bean.CompanyInfo;
import com.huoyun.company.bean.CompanyPerson;

public class CompanyServiceImpl implements CompanyService{
	private CompanyInfoDao companyInfoDao ;
	private CompanyPersonDao companyPersonDao ;
	
	public CompanyInfoDao getCompanyInfoDao() {
		return companyInfoDao;
	}

	public void setCompanyInfoDao(final CompanyInfoDao companyInfoDao) {
		this.companyInfoDao = companyInfoDao;
	}

	public CompanyPersonDao getCompanyPersonDao() {
		return companyPersonDao;
	}

	public void setCompanyPersonDao(final CompanyPersonDao companyPersonDao) {
		this.companyPersonDao = companyPersonDao;
	}
	
	public boolean saveCompanyInfo(final CompanyInfo companyInfo) {
		companyInfoDao.saveCompanyInfo(companyInfo);
		return true;
	}

	
	public boolean saveCompanyPerson(final CompanyPerson companyPerson) {
		companyPersonDao.saveCompanyPerson(companyPerson);
		return true;
	}
	
	public CompanyPerson getContactPersonById(long id) {
		// TODO Auto-generated method stub
		return companyPersonDao.getCompanyPersonById(id);
	}
	@Override
	public boolean updateCompanyInfo(CompanyInfo companyInfo) {
		// TODO Auto-generated method stub
		companyInfoDao.updateCompanyInfo(companyInfo);
		return true;
	}

	@Override
	public boolean updateCompanyPerson(CompanyPerson companyPerson) {
		// TODO Auto-generated method stub
		companyPersonDao.updateCompanyPerson(companyPerson);
		return true;
	}
	@Override
	public CompanyInfo getCompanyInfoByUserId(long userId) {
		// TODO Auto-generated method stub
		return companyInfoDao.getCompanyInfoByUserId(userId);
	}

	@Override
	public CompanyPerson getCompanyPersonByCompanyId(long companyId) {
		// TODO Auto-generated method stub
		return companyPersonDao.getCompanyPersonByCompanyId(companyId);
	}
}
